<template>
    <div class="gzshares">

<!--        <el-row :gutter="20">-->
<!--            <el-col :span="6">-->
<!--                <el-input v-model="input" placeholder="请输入内容"></el-input>-->
<!--            </el-col>-->
<!--            <el-col :span="6">-->
<!--                <el-button type="primary">添加</el-button>-->
<!--            </el-col>-->
<!--        </el-row>-->


        <el-container>
            <el-table
                    :data="sharesList"
                    style="width: 100%"
                    :row-key="getRowKeys"
                    :expand-row-keys="expands"
                    @row-click="clickRowHandle"
            >
                <el-table-column type="expand" width="1">
                    <template slot-scope="props" >
                        <el-form label-position="left" inline class="demo-table-expand">
                            <el-form-item label="">
                                <div v-for="vo in props.row.informs">
                                   {{ vo.type}}___{{vo.time}}
                                    <img :src="'https://andi159753.oss-cn-hangzhou.aliyuncs.com/'+vo.path"  width="100%">
                                </div>
<!--                                <el-divider content-position="left">分时概率</el-divider>-->

<!--                                <span>-->
<!--                  分时-->
<!--                  <div>-->
<!--                      <img :src="'data:image/png;base64,'+props.row.srcf" width="100%">-->
<!--                  </div>-->
<!--                  五分-->
<!--                  <div><img :src="'data:image/png;base64,'+props.row.src5" width="100%"></div>-->
<!--                  日K-->
<!--                  <div><img :src="'data:image/png;base64,'+props.row.srcr" width="100%"></div>-->
<!--                  周K-->
<!--                  <div><img :src="'data:image/png;base64,'+props.row.srcz" width="100%"></div>-->
<!--                  月K-->
<!--                  <div><img :src="'data:image/png;base64,'+props.row.srcy" width="100%"></div>-->
<!--                </span>-->

                            </el-form-item>
                        </el-form>
                    </template>
                </el-table-column>

                <el-table-column
                        label="代码"
                >
                    <template slot-scope="scope" >
                        <div>
                            {{ scope.row.code }}
                        </div>
                        <div>
                            {{ scope.row.name }}
                        </div>
                    </template>
                </el-table-column>

                <el-table-column
                        label="提示"
                >
                    <template slot-scope="scope">
                    </template>
                </el-table-column>
                <el-table-column
                        label="风险"
                >
                    <template slot-scope="scope">

                    </template>
                </el-table-column>
            </el-table>

        </el-container>

    </div>
</template>

<script>
    import Axios from 'axios';
    export default {
        name: 'Gzshares',
        props: {
            msg: String,
            id_code: String
        },
        data(){
            return{
                value1: '',
                value2: '',
                getRowKeys(row) {
                    return row.id;
                },
                sharesList:null,
                xianshi:null,
                img:null,
                srcr:null,
                checkedts: false,
                checkedcm: false,
                checkedzfs: false,
                checkedyfs: false,
                checkedzzdf: false,
                checkedzmax: false,
                checkedzf: false,
                checkedjj: false,
                checkedxtj: false,
                checkeddd: false,
                checkedbg: false,
                expands: [],
                kf:false,
                kr:false,
                k5:false,
                kz:false,
                ky:false,
                urltest:this.Global.httpUrl
            }
        },
        created(){
            console.log(this.$route.query.id_code);
            if(this.$route.query.id_code!=null){
                this.getListData(this.$route.query.id_code);
                this.activeNames=[];
            }
            //发送请求
            // this.getListData();
        },
        methods: {
            getvalue(){
                console.log(this.value1);
            },
            changestatus(itme){
            },
            clickRowHandle(row, column, event) {
                if (this.expands.includes(row.id)) {
                    this.expands = this.expands.filter(val => val !== row.id);
                } else {
                    this.expands.push(row.id);
                }
            },
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
            getListData(item){//网络请求数据
                var param="?";
                if(item!=null){
                    param=param+"code="+item
                }
                var url=this.Global.httpUrl+"sharesInform/getInformList"+param;
                Axios.get(url).then((response)=>{
                    this.sharesList=response.data.data;
                }).catch((error)=>{
                    console.log(error);
                })
            },
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

    .el-menu-vertical-demo:not(.el-menu--collapse) {
        width: 100px;
        min-height: 400px;
    }

</style>
